use v6.d;

# <driver>://(<user>:<pass>@)?<host>(:<port>)?/(<database>)?
unit grammar DSN; 
    
	rule TOP { <driver> '://' [ <user> \: <pass>  ]?  \@   <host> [':' <port>]? ['/' <database>]? }
	
	token driver {
		| 'sqlite'
		| 'postgres'
		| 'mysql'
		| 'odbc'
		| 'oracle'
	}
    
	token user { <[\w] - [\: \@ \? \.]>+ }

	token pass {  <[\w] - [\: \@ \? \.]>+ }

	token host {\S+}

	token port {\d+}

	token database { \w+ }






